<template>
  <div class="container">
    <div class="containerbox">
      <!-- <h1 class="title" @click="clickaaaaa()">
        {{ msg }}
      </h1> -->
      <div class="links">
        <nuxt-link to="/" class="button--green">首页1</nuxt-link>
      </div>

      {{ datadetail }}
    </div>
  </div>
</template>

<script>
export default {
  async asyncData({ params, $axios }) {
    try {
      let { id } = params
      let { data } = await $axios.get(`/api/blog/detail?id=${id}`)
      return {
        datadetail: data.data,
      }
      //请求文章详情接口
    } catch (err) {
      console.log(err)
    }
  },
  name: 'HelloWorld',
  computed: {},
  data() {
    return {
      dataList: [],
      msg: 'HelloWorld',
      activeNames: '',
    }
  },
  head() {
    return {
      title: '详情页面',
      meta: [
        {
          hid: 'description',
          name: 'description',
          content: 'My custom description',
        },
      ],
    }
  },
  mounted() {},
  methods: {
    handleChange() {},
  },
}
</script>

<style scoped>
.container {
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.containerbox {
  width: 600px;
  margin: 0 auto;
}

.title {
  font-family: 'Quicksand', 'Source Sans Pro', -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  display: block;
  font-weight: 300;
  font-size: 100px;
  color: #35495e;
  letter-spacing: 1px;
}

.subtitle {
  font-weight: 300;
  font-size: 42px;
  color: #526488;
  word-spacing: 5px;
  padding-bottom: 15px;
}

.links {
  padding-top: 15px;
  margin-bottom: 50px;
}
</style>
